package com.bdqn.t313.service;

import com.bdqn.t313.dao.NewsDao;
import com.bdqn.t313.dao.NewsMySQLDaoImpl;
import com.bdqn.t313.pojo.News;
import com.bdqn.t313.simplefactory.SimpleDaoFactory;

/**
 * 业务逻辑层实现类
 */
public class NewsServiceImpl implements NewsService {

    //private NewsDao newsDao = new NewsMySQLDaoImpl();
    //通过工厂获取产品实例
    //private NewsDao newsDao = SimpleDaoFactory.getInstance();
    private NewsDao newsDao;

    public void setNewsDao(NewsDao newsDao) {
        this.newsDao = newsDao;
    }

    @Override
    public int save(News news) {

        return newsDao.save(news);
    }
}
